package com.um.jdy.platform.device.manger;


import com.um.jdy.common.device.entity.dto.PortAlarmRecordDTO;
import com.um.jdy.common.device.entity.po.*;
import com.um.jdy.common.device.entity.vo.PortAlarmRecordVO;
import com.um.jdy.common.device.service.*;
import com.um.jdy.platform.device.entity.dto.*;
import com.um.jdy.platform.device.entity.vo.AlarmRecordItemVO;
import com.um.springboot.starter.entity.Page;
import com.um.springboot.starter.orm.entity.Response;
import com.um.springboot.starter.orm.manager.BasePlusManager;
import com.um.springboot.starter.orm.params.ListDTO;
import com.um.springboot.starter.orm.params.PageParams;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.RequestBody;

/**
 * 管理类：充电桩告警表
 */
@Service
@Slf4j
public class PortAlarmRecordManager extends BasePlusManager<PortAlarmRecordService, PortAlarmRecord, PortAlarmRecordDTO, PortAlarmRecordVO,AlarmRecordPageDTO, ListDTO> {

    /**
     * 分页查询充电枪
     *
     * @param pageParams
     * @return
     */
    public Response<Page<AlarmRecordItemVO>> getPage(@RequestBody PageParams pageParams) {
        Page<AlarmRecordItemVO> page = new Page<>();
        page.setPageNo(pageParams.getPageNo());
        page.setPageSize(pageParams.getPageSize());

        pageParams.getCondition().put("ar.com_id",getComId());

        page = service.getCMSViewModelPageBySqlName(page,"get_port_alarm_record_page","get_port_alarm_record_count",
                AlarmRecordItemVO.class,pageParams.getProperties(),pageParams.getValues(),pageParams.getRangeEntitys(),
                pageParams.getOrderNames(),pageParams.getSortOns());
        return Response.success(page);
    }

}
